export function dateFormat(value) {
    if (!value) return ''
    const date = new Date(value)
    const year = date.getFullYear()
    const month = date.getMonth() + 1 // 返回0-11，所以需要+1
    const day = date.getDate()
    const hour = date.getHours()
    const minute = date.getMinutes()
    const second = date.getSeconds()
    // return `${year}/${month}/${day} ${hour}:${minute}:${second}`
    return `${year}/${month}/${day}`
}
export function date(value) {
    if (!value) return ''
    const date = new Date(value)
    const year = date.getFullYear()
    const month = date.getMonth() + 1 // 返回0-11，所以需要+1
    const day = date.getDate()
    const hour = date.getHours()
    const minute = date.getMinutes()
    const second = date.getSeconds()
    return `${year}-${month}-${day} ${hour}:${minute}:${second}`
}
export function dateny(value) {
    if (!value) return ''
    const date = new Date(value)
    const year = date.getFullYear()
    const month = date.getMonth() + 1 // 返回0-11，所以需要+1
    const day = date.getDate()
    const hour = date.getHours()
    const minute = date.getMinutes()
    const second = date.getSeconds()
    return `${year}-${month}`
}
export function data(value) {
    if (!value) return ''
    const date = new Date(value)
    const year = date.getFullYear()
    const month = date.getMonth() + 1 // 返回0-11，所以需要+1
    const day = date.getDate()
    const hour = date.getHours()
    const minute = date.getMinutes()
    const second = date.getSeconds()
    return `${year}-${month}-${day}`
}
